package com.location.footprint.base;

import android.app.Application;

import androidx.multidex.MultiDex;

import com.didichuxing.doraemonkit.DoraemonKit;
import com.location.footprint.R;
import com.location.footprint.utils.LogUtil;
import com.location.footprint.utils.SPUtils;

public class BaseAppAplication extends Application {
    public static int theme = R.color.white;
    private static final String THEME = "theme";

    @Override
    public void onCreate() {
        super.onCreate();
        MultiDex.install(this);
        DoraemonKit.install(this);
        theme = (int) SPUtils.get(this, THEME, R.color.white);
    }

    @Override
    public void onTrimMemory(int level) {
        // 程序在内存清理的时候执行（回收内存）
        // HOME键退出应用程序、长按MENU键，打开Recent TASK都会执行
        LogUtil.e("onTrimMemory 程序关闭");
        SPUtils.put(this, THEME, theme);
        super.onTrimMemory(level);
    }
}
